function previewImage(event) {
    var reader = new FileReader();
    reader.onload = function() {
        var output = document.getElementById('fmyl');
        output.src = reader.result;
    };
    reader.readAsDataURL(event.target.files[0]);
}

tinymce.init({
    selector: '#wznr',
    plugins: [ 'table,link,quickbars,lists,advlist,code,image'],
    toolbar: 'undo redo | styleselect | bold italic | image | bullist numlist | code',
    menubar: false,
    relative_urls: false,
    quickbars_insert_toolbar: 'quickimage quicktable',
    images_upload_url: '/module/article/uploadImage',
    language:'zh_CN'
});

function tianjia(s){
    var btnr = $("#btnr").val();
    if(btnr==""||btnr==null){
        alert("标题为空");
        return;
    }
    var fmnr = $("#fmnr").val();
    if(fmnr==""||fmnr==null){
        alert("封面为空");
        return;
    }
    tinyMCE.triggerSave();
    var wznr = $("#wznr").val();
    if(wznr==""||wznr==null){
        alert("内容为空");
        return;
    }
    $("#form_state").val(s);
    var index = layer.load(0, {shade: false});
    $("#form").ajaxSubmit(function(ret) {
        if(ret.retCode=="0000"){
            layer.close(index); // 关闭 loading
            alert(ret.retDesc);
            location.reload();
        }else{
            layer.close(index); // 关闭 loading
            alert("失败");
        }
    });
}

alert("目前保存和提交效果一致 后期会上线修改功能");
